<%--
  - Author		:	Jaewon Choi
  - Description	:	
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});

			function validation(){
				try{
					if((document.frm.title.value).replace(/\s/g, '') == ""){
						alert("[제목]은 필수 입력 항목입니다.");
						document.frm.title.focus();
						return false;
					}
					
					if((document.frm.cont.value).replace(/\s/g, '') == ""){
						alert("[내용]은 필수 입력 항목입니다.");
						document.frm.cont.focus();
						return false;
					}
					
				}catch(err){
					return false;
				}
				
				return confirm("등록 하시겠습니까?");
			}
		</script>
	</head>
	<body>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="menuTitle">
					<c:choose>
						<c:when test="${param.gubun eq 'info'}">소개</c:when>
						<c:when test="${param.gubun eq 'partner'}">제휴 문의</c:when>
					</c:choose>
					등록
				</div>
				<c:set var="info" value="${infoList[0]}" />
				<form id="frm" name="frm" method="post" enctype="multipart/form-data" action="<c:url value="/info/submit.do" />" onsubmit="return validation();">
					<input type="hidden" name="gubun" value="${param.gubun}" />
					<table class="frmTbl">
						<colgroup>
							<col width="130px;" />
							<col width="*" />
						</colgroup>
						<tbody>
							<tr>
								<th>제목</th>
								<td>
									<input type="text" name="title" value="${info.title}" maxlength="50" style="width:660px;" />
								</td>
							</tr>
							<tr>
								<th>내용</th>
								<td>
									<textarea name="cont" maxlength="1000" style="width:660px;height: 150px;">${info.cont}</textarea>
								</td>
							</tr>
							<tr>
								<th>이미지 등록</th>
								<td style="line-height: 27px;padding:6px 0;">
									<input type="file" id="imgFile" name="imgFile" />
									<c:if test="${not empty info.imgUrl}">
										<br /><img src="<c:out value="${info.imgUrl}" />" class="thumbnailImg" />
									</c:if>
								</td>
							</tr>
						</tbody>
					</table>
					<input type="submit" class="btn" value="등록" />
				</form>
			</div>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
		</div>
	</body>
</html> 